public class MovieService extends ManagerService {

    public MovieService(CinemaSystem system) {
        super(system);
    }

    @Override
    public void showMenu() {
        System.out.println("\n===== 影片管理 =====");
        System.out.println("1.添加影片  2.查看影片  3.返回");
        System.out.print("请选择：");
    }

    @Override
    public void manage() {
        super.manage();
    }

    @Override
    public void add() {
        System.out.print("影片ID:");
        String id = Main.sc.nextLine();
        System.out.print("影片名称：");
        String name = Main.sc.nextLine();
        System.out.print("导演：");
        String director = Main.sc.nextLine();
        System.out.print("主演：");
        String actor = Main.sc.nextLine();
        System.out.print("时长（分钟）：");
        int duration = Main.sc.nextInt();
        System.out.print("评分：");
        double score = Main.sc.nextDouble();
        Main.sc.nextLine();

        Movie movie = new Movie(id, name, director, actor, "暂无简介", duration, score);
        system.getMovies().add(movie);
        System.out.println("影片添加成功！");
    }

    @Override
    public void showList() {
        System.out.println("\n===== 影片列表 =====");
            for (Movie movie : system.getMovies()) {
                System.out.println(
                        "名称：" + movie.getName() + " | 导演：" + movie.getDirector() + " | 评分：" + movie.getScore());
            }
    }
}
